import { ApiProperty } from '@nestjs/swagger';
import { IsNotEmpty, IsNumber, IsPositive } from 'class-validator';

export class UpdatePaymentDto {
  @ApiProperty({ description: '订单ID' })
  @IsNotEmpty({ message: '订单ID不能为空' })
  @IsNumber(
    { allowNaN: false, allowInfinity: false },
    { message: '订单ID必须为数字类型' },
  )
  @IsPositive({ message: '订单ID必须为正整数' })
  orderId: number;

  @ApiProperty({ description: '支付方式：1-微信，2-支付宝' })
  @IsNotEmpty({ message: '支付方式不能为空' })
  @IsNumber(
    { allowNaN: false, allowInfinity: false },
    { message: '支付方式必须为数字类型' },
  )
  type: number;

  @ApiProperty({ description: '支付金额' })
  @IsNotEmpty({ message: '支付金额不能为空' })
  @IsNumber(
    { allowNaN: false, allowInfinity: false },
    { message: '支付金额必须为数字类型' },
  )
  @IsPositive({ message: '支付金额必须为正数' })
  amount: number;
}
